//
//  YSMineHeaderView2.m
//  Yueshi
//
//  Created by Northwan on 15/8/30.
//  Copyright (c) 2015年 悦食中国. All rights reserved.
//

#import "YSMineHeaderView2.h"
#import "CustomNavigationCtrl.h"
#import "YSVoucherCtrl.h"
#import "YSMarkCtrl.h"
#import "YSOrderViewCtrl.h"
#import "YSModifyInfoCtrl.h"

@interface YSMineHeaderView2()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *viewConstraintW;

@end

@implementation YSMineHeaderView2

+(instancetype)headerView{
    return [[[NSBundle mainBundle]loadNibNamed:@"YSMineHeaderView2" owner:nil options:nil]lastObject];
}

- (void)awakeFromNib{
    [super awakeFromNib];
    self.viewConstraintW.constant = 0.5;
}

- (IBAction)tapAction:(UIButton *)sender {
    switch (sender.tag) {
        case 0://登陆
        {
            if(ISLOGIN){
                [self.viewController.navigationController pushViewController:[YSModifyInfoCtrl new] animated:YES];
            }else{
                [Utils showLoginCtrl:self.viewController];
            }
            break;
        }
        case 1://订单
        {
            CustomNavigationCtrl *nav = [[CustomNavigationCtrl alloc]initWithRootViewController:[YSOrderViewCtrl new]];
            [self.viewController.navigationController presentViewController:nav animated:YES completion:nil];
            break;
        }
        case 2://代金券
            if(ISLOGIN){
                [self.viewController.navigationController pushViewController:[YSVoucherCtrl new] animated:YES];
            }else{
                [Utils showLoginCtrl:self.viewController];
            }
            break;
        case 3://收藏
            [self.viewController.navigationController pushViewController:[YSMarkCtrl new] animated:YES];
            break;
            
        default:
            break;
    }
}


@end
